import utilAxios from '@/util/util-axios'

const mechanismApi = utilAxios.initBaseApi('common', 'mechanism')

const queryParams = []

const pageConfig = {
    limit: 20
}

const tableConfig = {
    mechanismId: {
        type: 'customer'
    }
}

const formConfig = {
    ...tableConfig
}

export async function init() {
    let res = await mechanismApi.list({limit: 999})
    tableConfig.mechanismId.dictList = res.records.map(item => {
        return {name: item.name, val: item.id}
    })

    return {
        queryParams,
        pageConfig,
        tableConfig,
        formConfig
    }
}
